<template>
  <div class="chat-container">
    <header class="chat-header">
      <div class="header-content">
        <div class="title-section">
          <h1 class="chat-title">AI 助手 <span class="emoji">🤖</span></h1>
          <p class="status">在线 <span class="dot"></span></p>
        </div>
      </div>
    </header>

    <main class="chat-main">
      <chat-window />
    </main>
  </div>
</template>

<script setup lang="ts">
import ChatWindow from '@/components/ChatWindow.vue'
</script>

<style scoped>
.chat-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, var(--background-light) 0%, #f0f4ff 100%);
}

.chat-header {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding: 0.5rem 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 95vw;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
}

.title-section {
  display: flex;
  flex-direction: column;
}

.chat-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  background: linear-gradient(45deg, #2196F3, #9C27B0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.emoji {
  -webkit-text-fill-color: initial;
}

.status {
  font-size: 0.875rem;
  color: rgba(0, 0, 0, 0.6);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dot {
  width: 8px;
  height: 8px;
  background: #4CAF50;
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s infinite;
}

.chat-main {
  flex: 1;
  overflow: hidden;
  position: relative;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4);
  }
  
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(76, 175, 80, 0);
  }
  
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
  }
}

/* 深色模式适配 */
:deep(.v-theme--dark) {
  .chat-container {
    background: linear-gradient(135deg, var(--background-dark) 0%, #1a1a2e 100%);
  }

  .chat-header {
    background: rgba(0, 0, 0, 0.8);
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }

  .chat-title {
    background: linear-gradient(45deg, #64b5f6, #ce93d8);
    -webkit-background-clip: text;
  }

  .status {
    color: rgba(255, 255, 255, 0.6);
  }
}

/* 响应式适配 */
@media (max-width: 768px) {
  .chat-title {
    font-size: 1.1rem;
  }

  .header-content {
    padding: 0.25rem;
  }
}
</style> 